package com.jiazhong.shopping.dao.impl;

import com.jiazhong.shopping.dao.DBUtil;
import com.jiazhong.shopping.dao.ShowTableDao;
import com.jiazhong.shopping.model.Eat;
import com.jiazhong.shopping.model.Table;

import java.util.ArrayList;
import java.util.List;

/**
 * @author hyhWTX
 * @version 1.0
 * @ClassName ShowTableDaoImpl
 * @date 2022年06月17日 11:24
 * @Description: TODO (一句话描述以下该类的功能)
 */
public class ShowTableDaoImpl extends DBUtil implements ShowTableDao {

    @Override
    public List<Table> find() {
        String sql = "select * from tbl_table";
        List<Table> tableList = super.executeQueryList(sql, Table.class);
        return tableList;
    }

    @Override
    public Table queryTableById(int table_id) {
        String sql = "select * from tbl_table where table_id=?";
        return super.executeQueryOne(sql, Table.class,table_id);
    }

    @Override
    public Table executeQueryList(String table_image) {
        String sql = "select * from tbl_table where table_image=?";
        return super.executeQueryOne(sql,Table.class,table_image);
    }
}
